<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        div{
            width: 100px;
            height: 100px;
            background-color: pink;
        }
    </style>
</head>
<body>
<div id="demo"></div>
<div id="test"></div>
<div id="another"></div>
<script>
    /*var demo = document.getElementById("demo");
    var test = document.getElementById("test");
    var another = document.getElementById("another");*/
    function $(id){
     return document.getElementById(id);
    }
    $("demo").style.backgroundColor = 'purple';
    $("test").style.backgroundColor = "blue";

</script>
</body>
</html>